//
//  AppDelegate.swift
//  上海微博
//
//  Created by teacher on 16/2/21.
//  Copyright © 2016年 itcast. All rights reserved.
//

import UIKit

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?


    func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
        
        print(UserAccount.sharedUserAccount)

        // 设置外观应该尽量早
        setupAppearance()
        
        window = UIWindow(frame: UIScreen.mainScreen().bounds)
        window?.backgroundColor = UIColor.whiteColor()
        
        // 会将控制器的视图添加为 window 的子视图
        window?.rootViewController = MainViewController()
        
        window?.makeKeyAndVisible()
        
        return true
    }
}

// MARK: - 设置应用程序
extension AppDelegate {
    
    /// 设置全局外观，一经设置全局有效
    private func setupAppearance() {
        UINavigationBar.appearance().tintColor = CZAppearanceTintColor
        UITabBar.appearance().tintColor = CZAppearanceTintColor
    }
}

